package client;

import javax.swing.table.DefaultTableModel;

public class DownloadTableModel extends DefaultTableModel {
	
	public static final boolean DEBUG = true;
	
	private String[] columnNames = { "Download", "State", "Progress (%)" };

	public int getColumnCount() {
		return columnNames.length;
	}


	public String getColumnName(int col) {
		return columnNames[col];
	}

	/*
	 * JTable uses this method to determine the default renderer/ editor for
	 * each cell. If we didn't implement this method, then the last column would
	 * contain text ("true"/"false"), rather than a check box.
	 */
	public Class getColumnClass(int c) {
		return getValueAt(0, c).getClass();
	}

	/*
	 * Don't need to implement this method unless your table's editable.
	 */
	public boolean isCellEditable(int row, int col) {
		// Note that the data/cell address is constant,
		// no matter where the cell appears onscreen.
		if (col < 2) {
			return false;
		} else {
			return true;
		}
	}
}